﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.Settlements.RetirementSettlementComponent
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using System.Xml;
using TaleWorlds.Core;
using TaleWorlds.ObjectSystem;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.Settlements
{
  public class RetirementSettlementComponent : SettlementComponent, ISpottable
  {
    [SaveableField(10)]
    private bool _isSpotted;

    internal static void AutoGeneratedStaticCollectObjectsRetirementSettlementComponent(
      object o,
      List<object> collectedObjects)
    {
      ((MBObjectBase) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    internal static object AutoGeneratedGetMemberValue_isSpotted(object o)
    {
      return (object) ((RetirementSettlementComponent) o)._isSpotted;
    }

    public bool IsSpotted
    {
      get => this._isSpotted;
      set => this._isSpotted = value;
    }

    public override void Deserialize(MBObjectManager objectManager, XmlNode node)
    {
      base.Deserialize(objectManager, node);
      if (node.Attributes["background_crop_position"] != null)
        this.BackgroundCropPosition = float.Parse(node.Attributes["background_crop_position"].Value);
      if (node.Attributes["background_mesh"] != null)
        this.BackgroundMeshName = node.Attributes["background_mesh"].Value;
      if (node.Attributes["wait_mesh"] == null)
        return;
      this.WaitMeshName = node.Attributes["wait_mesh"].Value;
    }

    protected override void OnInventoryUpdated(ItemRosterElement item, int count)
    {
    }
  }
}
